Intra prediction method of chrominance block using luminance sample, and apparatus using same

ABSTRACT

Disclosed are an intra prediction method of a chrominance block using a luminance sample and an apparatus using the same. An image decoding method comprises the steps of: calculating an intra prediction mode of a chrominance block on the basis of an LM mapping table when the chrominance block uses an LM; and generating a prediction block for the chrominance block on the basis of the calculated intra prediction mode of the chrominance block. When intra prediction mode information of chrominance blocks are decoded, mutually different tables are used depending on whether or not an LM is used, so that encoding and decoding can be performed without an unnecessary waste of bits.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.16/458,633, filed on Jul. 1, 2019, now allowed, which is a continuationof U.S. application Ser. No. 16/017,143, filed on Jun. 25, 2018, nowU.S. Pat. No. 10,623,768, which is a continuation of U.S. applicationSer. No. 15/790,236, filed on Oct. 23, 2017, now U.S. Pat. No.10,009,631, which is a continuation of U.S. application Ser. No.15/389,712, filed on Dec. 23, 2016, now U.S. Pat. No. 9,800,894, whichis a continuation of U.S. application Ser. No. 14/000,900, filed on Aug.22, 2013, now U.S. Pat. No. 9,530,224, which is U.S. National PhaseApplication under 35 U.S.C. § 371 of International ApplicationPCT/KR2012/001637, filed on Mar. 6, 2012, which claims the benefit ofU.S. Provisional Application No. 61/449,698, filed on Mar. 6, 2011, U.S.Provisional Application No. 61/454,586, filed on Mar. 21, 2011, and U.S.Provisional Application No. 61/589,308, filed on Jan. 21, 2012, theentire content of the prior applications is hereby incorporated byreference.

TECHNICAL FIELD

The present invention relates to image decoding method and device, andmore particularly, to an intra chroma block prediction method using aluma sample and a device using the method.

BACKGROUND ART

Recently, demands for a high-resolution and high-quality image such asan HD (High Definition) image and an UHD (Ultra High Definition) imagehave increased in various fields of applications. As image data hashigher resolution and higher quality, an amount of data more increasesrelative to existing image data. Accordingly, when image data istransferred using media such as existing wired and wireless broad bandlines or is stored in existing storage media, the transfer cost and thestorage cost increases. In order to solve these problems occurring withan increase in resolution and quality of image data, high-efficiencyimage compressing techniques may be utilized.

The image compressing techniques include various techniques such as aninter prediction technique of predicting pixel values included in acurrent picture from previous or subsequent pictures of the currentpicture, an intra prediction technique of predicting pixel valuesincluded in a current picture using pixel information in the currentpicture, and an entropy encoding technique of assigning a short code toa value with a high appearance frequency and assigning a long code to avalue with a low appearance frequency. Image data may be effectivelycompressed and transferred or stored using such image compressingtechniques.

SUMMARY OF THE INVENTION Technical Problem

An object of the invention is to provide an intra chroma blockprediction method which may enhance image encoding and decodingefficiency.

Another object of the invention is to provide a device that performs theintra chroma block prediction method which may enhance image encodingand decoding efficiency.

Solution to Problem

According to an aspect of the invention, there is provided an imagedecoding method including: deriving an intra prediction mode of a chromablock on the basis of an LM mapping table when an LM (Luma EstimatedMode) is used for the chroma block; and generating a predicted block ofthe chroma block on the basis of the derived intra prediction mode ofthe chroma block.

The image decoding method may further include deriving the intraprediction mode of the chroma block on the basis of a non-LM mappingtable when the LM is not used for the chroma block. When a planar modeis mapped onto a zeroth intra prediction mode, a DC mode is mapped ontoa first intra prediction mode, and directive intra prediction modes aremapped onto second to 34-th intra prediction modes, the non-LM mappingtable may be

IntraPredMode[xB][yB] intra_chroma_ X pred_mode 0 26 10 1 (0 <= X < 35)0 34 0 0 0 0 1 26 34 26 26 26 2 10 10 34 10 10 3 1 1 1 34 1 4 0 26 10 1X

The image decoding method may further include decoding information onwhether the LM is used for the chroma block.

The image decoding method may further include receiving codewordinformation which is obtained by encoding the intra prediction mode ofthe chroma block.

The codeword information may be codeword information generated on thebasis of a codeword mapping table in which different codewordinformation elements are mapped depending on whether the LM is used forthe chroma block. The codeword mapping table may be

Value of chroma_pred_from_ chroma_pred_from_ intra_chroma_ luma_enabled_luma_enabled_ pred_mode flag = 1 flag = 0 5 0 n/a 4 10 0 0 1100 100 11101 101 2 1110 110 3 1111 111

A codeword of intra_chroma_pred_mode corresponding to the LM or DM inthe codeword mapping table is performed context decoding process and theother bits of the codeword except for the bits of the codeword used inthe LM or DM in the codeword of intra_chroma_pred_mode corresponding tothe intra prediction mode other than the LM or DM are performed a bypassencoding process.

When intra prediction is performed using the LM, two bits of a codewordis performed a context decoding process and the other bits of thecodeword except for the bits performed the context encoding process isperformed a bypass decoding process, and when intra prediction isperformed without using the LM one bit of a codeword is performed acontext decoding process and the bits of the codeword except for the bitperformed the context decoding process is performed a bypass decodingprocess.

When a planar mode is mapped onto a zeroth intra prediction mode, a DCmode is mapped onto a first intra prediction mode, directive intraprediction modes are mapped onto second to 34-th intra prediction modes,and the LM is mapped onto a 35-th intra prediction mode, the LM mappingtable may be

intra_chroma_ IntraPredMode[xB][yB] pred_mode 0 26 10 1 X (0 <= X < 35)0 34 0 0 0 0 1 26 34 26 26 26 2 10 10 34 10 10 3 1 1 1 34 1 4 LM LM LMLM LM 5 0 26 10 1 X

The LM may be an intra prediction method of calculating pixels of thechroma block on the basis of interpolated luma sample values calculatedby linearly interpolating pixels of a luma block.

According to another aspect of the invention, there is provided an imagedecoding device including: an LM use determination module thatdetermines information on whether an LM (Luma Estimated Mode) is usedfor a chroma block; and an intra chroma block prediction mode derivationmodule that derives an intra chroma block prediction mode on the basisof the LM mode use information output from the LM use determinationmodule.

The intra chroma block prediction mode derivation module may generate acodeword on the basis of a codeword mapping table in which differentcodeword information elements are mapped depending on whether the LM isused for the chroma block. The codeword mapping table may be

Value of chroma_pred_from_ chroma_pred_from_ intra_chroma_ luma_enabled_luma_enabled_ pred_mode flag = 1 flag = 0 5 0 n/a 4 10 0 0 1100 100 11101 101 2 1110 110 3 1111 111

A codeword of intra_chroma_pred_mode corresponding to the LM or DM inthe codeword mapping table is performed a context decoding process andthe other bits of the codeword except for the bits of the codeword usedin the LM or DM in the codeword of intra_chroma_pred_mode correspondingto the intra prediction mode other than the LM or DM are performed abypass encoding process.

When intra prediction is performed using the LM, two bits of a codewordis performed a context decoding process and the other bits of thecodeword except for the bits performed the context encoding process isperformed a bypass decoding process, and when intra prediction isperformed without using the LM one bit of a codeword is performed acontext decoding process and the bits of the codeword except for the bitperformed the context decoding process is performed a bypass decodingprocess.

The intra chroma block prediction mode derivation module may derive theintra prediction mode of a chroma block on the basis of an LM mappingtable when the LM is used for the chroma block and may derive the intraprediction mode of the chroma block on the basis of a non-LM mappingtable when the LM is not used for the chroma block.

When a planar mode is mapped onto a zeroth intra prediction mode, a DCmode is mapped onto a first intra prediction mode, directive intraprediction modes are mapped onto second to 34-th intra prediction modes,and the LM is mapped onto a 35-th intra prediction mode, the LM mappingtable may be

intra_chroma_ IntraPredMode[xB][yB] pred_mode 0 26 10 1 X (0 <= X < 35)0 34 0 0 0 0 1 26 34 26 26 26 2 10 10 34 10 10 3 1 1 1 34 1 4 0 26 10 1X

When a planar mode is mapped onto a zeroth intra prediction mode, a DCmode is mapped onto a first intra prediction mode, and directive intraprediction modes are mapped onto second to 34-th intra prediction modes,the non-LM mapping table may be

intra_chroma_ IntraPredMode[xB][yB] pred_mode 0 26 10 1 X (0 <= X < 35)0 34 0 0 0 0 1 26 34 26 26 26 2 10 10 34 10 10 3 1 1 1 34 1 4 LM LM LMLM LM 5 0 26 10 1 X

The LM may be an intra prediction method of calculating pixels of thechroma block on the basis of interpolated luma sample values calculatedby linearly interpolating pixels of a luma block.

Advantageous Effects

As described above, by employing the intra chroma block predictionmethod using a luma sample and the device using the method according tothe embodiments of the invention, it is possible to perform intra chromablock prediction by determining intra chroma block prediction modeinformation on whether an LM is used to perform intra prediction andusing different mapping tables depending on the determination result.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating an image encoding deviceaccording to an embodiment of the invention.

FIG. 2 is a block diagram illustrating an image decoding deviceaccording to an embodiment of the invention.

FIG. 3 is a conceptual diagram illustrating positions of luma samplesand chroma samples in an embodiment of the invention.

FIG. 4 is a diagram illustrating luma sample values around and inside acurrent block in an embodiment of the invention.

FIG. 5 is a diagram illustrating a directive intra prediction mode in anembodiment of the invention.

FIG. 6 is a flowchart illustrating a method of calculating an intraprediction mode of a chroma block in an embodiment of the invention.

FIG. 7 is a conceptual diagram illustrating a part of a predictionmodule that decodes an intra prediction mode of a chroma block in anembodiment of the invention.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

The present invention may be variously modified in various forms, andspecific embodiments thereof will be described and shown in thedrawings. However, the embodiments are not intended for limiting theinvention, but it should be understood that the invention includes allthe modifications, equivalents, and replacements belonging to the spiritand technical scope of the invention. In description with reference tothe drawings, like constituents are referenced by like referencenumerals.

Terms such as “first” and “second” may be used to describe variouselements, but the elements are not limited to the terms. The terms areused only to distinguish one element from another element. For example,without departing from the scope of the invention, a first element maybe named a second element and the second element may be named the firstelement similarly. The term, “and/or”, includes a combination of pluralelements or any one of the plural elements.

If it is mentioned that an element is “connected to” or “coupled to”another element, it should be understood that still another element maybe interposed therebetween, as well as that the element may be connectedor coupled directly to another element. On the contrary, if it ismentioned that an element is “connected directly to” or “coupleddirectly to” another element, it should be understood that still anotherelement is not interposed therebetween.

The terms used in the following description are used to merely describespecific embodiments, but are not intended to limit the invention. Anexpression of the singular number includes an expression of the pluralnumber, so long as it is clearly read differently. The terms such as“include” and “have” are intended to indicate that features, numbers,steps, operations, elements, components, or combinations thereof used inthe following description exist and it should be thus understood thatthe possibility of existence or addition of one or more differentfeatures, numbers, steps, operations, elements, components, orcombinations thereof is not excluded.

Hereinafter, exemplary embodiments of the invention will be described indetail with reference to the accompanying drawings. Like constituents inthe drawings will be referenced by like reference numerals and will notbe repeatedly described.

FIG. 1 is a block diagram illustrating an image encoding deviceaccording to an embodiment of the invention.

Referring to FIG. 1, an image encoding device 100 includes a picturepartitioning module 105, a prediction module 110, a transform module115, a quantization module 120, a rearrangement module 125, an entropyencoding module 130, an inverse quantization module 135, an inversetransform module 140, a filter module 145, and a memory 150.

The constituents shown in FIG. 1 are independently shown to representdifferent distinctive functions in the image encoding device. Eachconstituent is not constructed by an independent hardware constituent orsoftware constituent. That is, the constituents are independentlyarranged and at least two constituents may be combined into a singleconstituent or a single constituent may be divided into pluralconstituents to perform functions. Embodiments in which the constituentsare combined and embodiments in which the constituents are separatedbelong to the scope of the invention without departing from the conceptof the invention.

Some constituents are not essential to the substantial functions in theinvention and may be optional constituents for merely improvingperformance. The invention may be embodied to include only constituentsessential to embodiment of the invention, except for the constituentsused to merely improve performance. The structure including only theessential constituents except for the optical constituents used tomerely improve performance belongs to the scope of the invention.

The picture partitioning module 105 may partition an input picture intoat least one process unit. Here, the process unit may be a predictionunit (PU), a transform unit (TU), or a coding unit (CU). The picturepartitioning module 105 may partition a picture into combinations ofplural coding units, prediction units, and transform units and mayselect a combination of coding units, prediction units, and transformunits on the basis of a predetermined criterion (for example, a costfunction) to encode the picture.

For example, a picture may be partitioned into plural coding units. Arecursive tree structure such as a quad tree structure may be used topartition a picture into coding units. A coding unit which may be apicture or a coding unit of a maximum size as root may be partitionedinto different coding units with child nodes corresponding to the numberof partitioned coding units. A coding unit which is not partitioned anymore in accordance with a predetermined limitation is a leaf node. Thatis, when it is assumed that a coding unit may be partitioned in only asquare shape, a single coding unit may be partitioned into a maximum offour different coding unit.

In the embodiments of the invention, a coding unit may be used to have ameaning of a unit to be decoded as well as a unit to be encoded.

A prediction unit may be partitioned in at least one square orrectangular shape with the same size in a coding unit, or may bepartitioned in shapes such that the shape of one prediction unit ofpartitioned prediction units in a coding unit is different from theshape of another prediction unit.

When a coding unit, which is used to generate a prediction unit to besubjected to intra prediction, is not a minimum coding unit, the codingunit may be subjected to intra prediction without being partitioned intoplural prediction units (N×N).

The prediction module 110 includes an inter prediction module thatperforms inter prediction and an intra prediction module that performsintra prediction. The prediction module may determine which of interprediction or intra prediction should be performed on a prediction unit,and may determine specific information (for example, intra predictionmode, motion vector, and reference picture) of the determined predictionmethod. At this time, the process unit on which the prediction isperformed may be different from the process unit for which theprediction method and the specific information are determined. Forexample, the prediction method and the prediction mode may be determinedfor each prediction unit and the prediction may be performed for eachtransform unit. Residual values (residual block) between the generatedpredicted block and the original block are input to the transform module115. The prediction mode information, the motion vector information, andthe like used for the prediction are encoded along with the residualvalues by the entropy encoding module 130 and are transmitted to thedecoding device. When a specific encoding mode is used, the originalblock may be encoded and transmitted to the decoding device withoutgenerating a predicted block through the use of the prediction module110.

The inter prediction module may predict a prediction unit on the basisof information of at least one picture of a previous picture and asubsequent picture of a current picture. The inter prediction module mayinclude a reference picture interpolation module, a motion predictionmodule, and a motion compensation module.

The reference picture interpolation module is supplied with referencepicture information from the memory 150 and generates pixel informationless than an integer pixel from the reference picture. In case of lumapixels, a DCT-based 8-tap interpolation filter having different filtercoefficients may be used to generate the pixel information less than aninteger pixel in the unit of ¼ pixel. In case of chroma pixels, aDCT-based 4-tap interpolation filters having different filtercoefficients may be used to generate the pixel information less than aninteger pixel in the unit of ⅛ pixel.

The motion prediction module may perform motion prediction on the basisof the reference picture interpolated by the reference pictureinterpolation module. Various methods such as FBMA (Full search-basedBlock Matching Algorithm), TSS (Three Step Search), and NTS (NewThree-Step Search Algorithm) may be used to calculate a motion vector. Amotion vector has a motion vector value in the unit of ½ or ¼ pixel onthe basis of the interpolated pixel. The motion prediction module maypredict a current prediction unit using different motion predictionmethods. Various methods such as a skip method, a merging method, and anAMVP (Advanced Motion Vector Prediction) method may be used as themotion prediction method.

A method of constructing a predicted motion vector candidate list atperforming inter prediction using the AMVP method according to anembodiment of the invention will be described below.

The intra prediction module may generate a prediction unit on the basisof reference pixel information around a current block which is pixelinformation in the current picture. When a block around the currentprediction unit is a block having been subjected to the inter predictionand a reference pixel is a pixel having been subjected to the interprediction, reference pixels of the block having been subjected to theinter prediction may be replaced with reference pixel information of ablock having been subjected to the intra prediction. That is, when areference pixel is not available, the reference pixel information notavailable may be replaced with at least one reference pixel of theavailable reference pixels.

The prediction mode of intra prediction includes a directive predictionmode in which reference pixel information is used depending on theprediction direction and a non-directive prediction mode in whichdirectivity information is not used to perform prediction. The mode forpredicting luma information and the mode for predicting chromainformation may be different from each other. Intra prediction modeinformation obtained by luma information or predicted luma signalinformation may be used to predict the chroma information.

When the size of a prediction unit and the size of a transform unit areequal to each other at performing intra prediction, the intra predictionof the prediction unit may be performed on the basis of pixels locatedon the left side of the prediction unit, a pixel located at theleft-upper end, and pixels located at the upper end. On the other hand,when the size of a prediction unit and the size of a transform unit aredifferent from each other at performing intra prediction, the intraprediction may be performed using reference pixels based on thetransform unit. Intra prediction using N×N partitioning for only theminimum coding unit may be performed.

In the intra prediction method, an MDIS (Mode Dependent Intra Smoothing)filter is applied to reference pixels depending on the prediction modeand then a predicted block may be generated. The type of the MDIS filterapplied to the reference pixels may vary. In the intra predictionmethod, the intra prediction mode of a current prediction unit may bepredicted from the intra prediction mode of a prediction unit locatedaround the current prediction unit. When the prediction mode of thecurrent prediction unit is predicted using the mode informationpredicted from the neighboring prediction units and the intra predictionmodes of the current prediction unit, if the neighboring predictionunits are equal to each other, information representing that theprediction modes of the current prediction unit and the neighboringprediction units are equal to each other may be transmitted usingpredetermined flag information. If the prediction modes of the currentprediction unit and the neighboring prediction units are different fromeach other, the prediction mode information of the current block may beencoded by performing entropy encoding.

A residual block including residual information which is a differencebetween a prediction unit and the original block of the prediction unitmay be generated. The generated residual block may be input to thetransform module 115. The transform module 115 may transform theresidual block including the residual information of the prediction unitgenerated by the prediction module 110 and the original block using atransform method such as DCT (Discrete Cosine Transform) or DST(Discrete Sine Transform). Which of the DCT and the DST is used totransform the residual block may be determined on the basis of the intraprediction mode information of the prediction unit used to generate theresidual block.

The quantization module 120 may quantize values transformed into thefrequency domain by the transform module 115. The quantizationcoefficients may be changed depending on the block or the degree ofimportance of a picture. The values output from the quantization module120 may be supplied to the inverse quantization module 135 and therearrangement module 125.

The rearrangement module 125 may rearrange the coefficient values withrespect to the quantized residual values.

The rearrangement module 125 may change two-dimensional block typecoefficients to one-dimensional vector type coefficients through the useof a coefficient scanning method. For example, the rearrangement module125 may scan DC coefficients to coefficients of the high frequencydomain using a zigzag scanning method to change the scanned coefficientsto one-dimensional vector type coefficients. A vertical scanning methodof scanning two-dimensional block type coefficients in the columndirection and a horizontal scanning method of scanning two-dimensionalblock type coefficients in the row direction may be used instead of thezigzag scanning method depending on the size of a transform unit and theintra prediction mode. That is, which of the zigzag scanning method, thevertical scanning method, and the horizontal scanning method should beused may be determined depending on the size of a transform unit and theintra prediction mode.

The entropy encoding module 130 may perform entropy encoding on thebasis of the values generated by the rearrangement module 125. Variousencoding methods such as exponential golomb coding, VLC (Variable lengthCoding), and CABAC (Context-Adaptive Binary Arithmetic Coding) may beused for the entropy encoding.

The entropy encoding module 130 may encode a variety of information suchas residual coefficient information and block type information of acoding unit, prediction mode information, partitioning unit information,prediction unit information, transfer unit information, motion vectorinformation, reference frame information, block interpolationinformation, and filtering information from the rearrangement module 125and the prediction module 110.

The entropy encoding module 130 may entropy-encode coefficient values ofthe coding unit input from the rearrangement module 125.

The inverse quantization module 135 and the inverse transform module 140inversely quantize the values quantized by the quantization module 120and inversely transform the values transformed by the transform module115. The residual values generated by the inverse quantization module135 and the inverse transform module 140 may be added with theprediction unit, which is predicted by the motion vector predictionmodule, the motion compensation module, and the intra prediction moduleof the prediction module 110, to generate a reconstructed block.

The filter module 145 may include at least one of a deblocking filter,an offset correction module, and an ALF (Adaptive Loop Filter).

The deblocking filter 145 may remove block distortion generated due tothe boundary between blocks in the reconstructed picture. Whether thedeblocking filter is applied to a current block may be determined on thebasis of the pixels included in several rows or columns of the block.When the deblocking filter is applied to a block, a strong filter or aweak filter may be applied depending on the necessary deblockingfiltering strength. When performing horizontal filtering and verticalfiltering for applying the deblocking filter, the horizontal filteringand the vertical filtering may be performed in parallel.

The offset correction module may correct an offset of the pictureperformed the deblocking from the original picture in the unit ofpixels. A method of partitioning the pixels of a picture into apredetermined number of regions, determining a region to be subjected tothe offset correction, and applying the offset correction to thedetermined region or a method of applying the offset correction inconsideration of edge information of each pixel may be used to performthe offset correction on a specific picture.

The ALF (Adaptive Loop Filter) may perform filtering on the basis ofcomparison result of the filtered reconstructed picture and the originalpicture. The pixels included in a picture may be partitioned intopredetermined groups, a filter to be applied to each group may bedetermined, and the filtering may be differently performed for eachgroup. Information on whether the ALF should be applied may betransferred by the coding units (CU) and the size and coefficients ofthe ALF to be applied to each block may vary. The ALF may have varioustypes and the number of coefficients included in the correspondingfilter may vary. The filtering-related information (such as filtercoefficient information, ALF ON/OFF information, and filter typeinformation) of the ALF may be included and transferred in apredetermined parameter set of a bitstream.

The memory 150 may store the reconstructed block or picture output fromthe filter module 145 and the stored reconstructed block or picture maybe supplied to the prediction module 110 when performing the interprediction.

FIG. 2 is a block diagram illustrating an image decoding deviceaccording an embodiment of the invention.

Referring to FIG. 2, an image decoding device 200 includes an entropydecoding module 210, a rearrangement module 215, an inverse quantizationmodule 220, an inverse transform module 225, a prediction module 230, afilter module 235, and a memory 240.

When an image bitstream is input from the image encoding device, theinput bitstream may be decoded in the inverse order of that in the imageencoding device.

The entropy decoding module 210 may perform entropy decoding in theinverse order of the entropy encoding process performed the entropyencoding module of the image encoding device. The residual valuesperformed the entropy decoding by the entropy decoding module may beinput to the rearrangement module 215.

The entropy decoding module 210 may decode information associated withthe intra prediction and the inter prediction performed by the encodingdevice. As described above, there are predetermined restrictions inperforming the intra prediction and the inter prediction, the entropydecoding module may perform the entropy decoding based on therestrictions to get the information of a current block associated withthe intra prediction and the inter prediction.

The rearrangement module 215 may perform rearrangement on the bitstreamentropy-decoded by the entropy decoding module 210 on the basis of therearrangement method of the encoding module. The rearrangement modulemay reconstruct and rearrange coefficients expressed in the form ofone-dimensional vector into two-dimensional block type coefficients. Therearrangement module 215 may be supplied with information associatedwith the coefficient scanning performed by the encoding module and mayperform the rearrangement using a method of inversely scanning thecoefficients on the basis of the scanning order in which the scanning isperformed by the encoding module.

The inverse quantization module 220 may perform inverse quantization onthe basis of the quantization parameters supplied from the encodingdevice and the rearranged coefficient values of the block.

The inverse transform module 225 may perform the inverse DCT and inverseDST depending on the DCT and DST, which has been performed by thetransform module in the image encoding device. The inverse transform maybe performed on the basis of a transfer unit determined by the imageencoding device. The transform module of the image encoding device mayselectively perform the DCT and DST depending on plural informationelements such as the prediction method, the size of the current block,and the prediction direction, and the inverse transform module 225 ofthe image decoding device may perform the inverse transform on the basisof the transform information performed by the transform module of theimage encoding device.

The inverse transform may be performed by the coding units instead ofthe transform units having been subjected to the transform.

The prediction module 230 may generate a predicted block on the basis ofpredicted block generation information supplied from the entropydecoding module 210 and the previously-decoded block or pictureinformation supplied from the memory 240.

As described above, similarly to the operation of the image encodingdevice, when the size of a prediction unit and the size of a transformunit are equal to each other at performing the intra prediction, theintra prediction on the prediction unit is performed on the basis ofpixels located on the left side of the prediction unit, a pixel locatedat the left-upper end, and pixels located at the upper end. On the otherhand, when the size of a prediction unit and the size of a transformunit are different from each other at perform intra prediction, theintra prediction may be performed using reference pixels based on thetransform unit. Intra prediction using N×N partitioning for only theminimum coding unit may be performed.

The prediction module 230 includes a prediction unit determinationmodule, an inter prediction module, and an intra prediction module. Theprediction unit determination module may receive a variety ofinformation such as prediction unit information input from the entropydecoding module, prediction mode information of the intra predictionmethod, and motion prediction-related information of the interprediction method, may determine a prediction unit from the currentcoding unit, and may determine which of the inter prediction and theintra prediction should be performed on the prediction unit. The interprediction module may perform the inter prediction on the currentprediction unit on the basis of information included in at least onepicture of a previous picture and a subsequent picture of the currentpicture including the current prediction unit using informationnecessary for the inter prediction of the current prediction unitsupplied from the image encoding device.

In order to perform the inter prediction, it may be determined which ofa skip mode, a merging mode, and an AMVP mode is the motion predictionmethod of the prediction unit included in the coding unit on the basisof the coding unit.

The intra prediction module may generate a predicted block on the basisof pixel information in the current picture. When a prediction unit isthe prediction unit applied to the intra prediction, the intraprediction may be performed on the basis of the intra prediction modeinformation of the prediction unit supplied from the image encodingdevice. The intra prediction module may include an MDIS filter, areference pixel interpolation module, and a DC filter. The MDIS filterperforms filtering on the reference pixels of the current block. It isdetermined whether the filter should be applied depending on theprediction mode of the current prediction unit. The MDIS filter mayperform filtering on the reference pixels of the current block using theprediction mode of the prediction unit and the MDIS filter informationsupplied from the image encoding device. When the prediction mode of thecurrent block is a mode in which the MDIS filtering is not performed,the MDIS filter may not be applied.

When the prediction mode of the prediction unit is a prediction unit tobe applied to the intra prediction on the basis of the pixel valuesobtained by interpolating the reference pixels, the reference pixelinterpolation module may generate reference pixels in the unit of pixelsless than an integer by interpolating the reference pixels. When theprediction mode of the current prediction unit is a prediction mode inwhich a predicted block is generated without interpolating the referencepixels, the reference pixels may not be interpolated. When theprediction mode of the current block is the DC mode, the DC filter maygenerate a predicted block through filtering.

The reconstructed block or picture may be supplied to the filter module235. The filter module 235 includes a deblocking filter, an offsetcorrection module, and an ALF.

Information on whether the deblocking filter is applied to thecorresponding block or picture and information on which of the strongfilter and the weak filter has been applied when the deblocking filterhas been applied may be supplied from the image encoding device. Thedeblocking filter of the image decoding device may be supplied with thedeblocking filter-related information from the image encoding device andmay perform deblocking filtering on the corresponding block in thedecoding device. Similarly to the image encoding device, the verticaldeblocking filtering and the horizontal deblocking filter are firstperformed, where at least one of the vertical deblocking filtering andthe horizontal deblocking filtering may be performed on an overlappingportion. The vertical deblocking filtering or the horizontal deblockingfiltering which is not previously performed may be performed on theportion in which the vertical deblocking filtering and the horizontaldeblocking filtering overlap. The parallel processing of the deblockingfiltering processes may be performed through this deblocking filtering.

The offset correction module may perform offset correction on thereconstructed picture on the basis of the type of the offset correctionand the offset value information applied to the picture in encoding.

The ALF may perform the filtering on the basis of the comparison resultbetween the reconstructed picture subjected to the filtering and theoriginal picture. The ALF may be applied to the coding unit on the basisof the ALF application information and the ALF coefficient informationsupplied from the encoding device. The ALF information may be includedand supplied in a specific parameter set.

The memory 240 may store the reconstructed picture or block for use as areference picture or a reference block and may supply the reconstructedpicture to an output module.

As described above, in the embodiments of the invention, the coding unitis used as a term representing an encoding unit, but may be used as aunit of decoding as well as encoding.

An image encoding method and an image decoding method to be describedlater in the embodiments of the invention may be performed by theconstituents of the image encoding device and the image decoding devicedescribed above with reference to FIGS. 1 and 2. The constituents mayinclude software process units which may be performed throughalgorithms, as well as hardware constituents.

FIG. 3 is a conceptual diagram illustrating locations of luma samplesand chroma samples according to an embodiment of the invention.

Referring to FIG. 3, the sampling rate and the sampling positions ofluma samples 300 and chroma samples 320 may be different from eachother.

The luma samples 300 and the chroma samples 320 may constitute a picturein various formats. For example, when YUV 4:2:0 sampling is used for theluma samples 300 and the chroma samples 320 of a picture, the chromasamples 320 Cb and Cr may be located between the luma samples 300.Therefore, the luma samples 300 and the chroma samples 320 do not matchin position, and the amount of data in the horizontal and verticaldirections of the chroma samples 320 is a half of the luma samples.

According to an embodiment of the invention, the luma samples may beused to calculate the predicted values of the chroma samples.

Expression 1 expresses the predicted values of the chroma samples.

P′ _(c)(x,y)=α×0.5×[P _(L)(2x,2y)+P _(L)(2x,2y+1)]+β  Expression 1

P′_(c) represents the predicted value of a chroma sample in a block andP_(L*)(x)=0.5×(2x, 2y)+[P_(L) (2x, 2y+1)] represents a luma sample of areconstructed block. Parameters α and β may be derived frompreviously-reconstructed samples around the current block.

The sampling rate of the chroma samples may be half the sampling rate ofthe luma samples and may have a phase difference of 0.5 pixels in thevertical direction. The reconstructed luma samples may be down-sampledin the vertical direction and sub-sampled in the horizontal direction soas to match the phase and the size of the chroma samples.

Therefore, in the chroma sample prediction method according to theembodiment of the invention, it is possible to calculate the predictedvalues of the chroma samples reflecting the phase difference between thechroma samples and the luma samples by using the value ofP_(L*)(x,y)=0.5×[P_(L)(2x,2y)+P_(L)(2x, 2y+1)] as the sample value ofthe reconstructed luma block in consideration of the phase difference.

Expression 2 is a mathematic formula representing a method ofcalculating parameters α and

$\begin{matrix}{{\alpha = \frac{R\left( {{\hat{P}}_{L^{*}},{\hat{P}}_{C}} \right)}{R\left( {{\hat{P}}_{L^{*}},{\hat{P}}_{L^{*}}} \right)}}{\beta = {{M\left( {\hat{P}}_{C} \right)} - {\alpha \times {M\left( {\hat{P}}_{L^{*}} \right)}}}}} & {{Expression}\mspace{14mu} 2}\end{matrix}$

In Expression 2, R(⋅,⋅)) may be defined as a function of calculating therelation value of input variables. For example, it is a correlationfunction or an auto covariance function which is a function ofcalculating the relation value between two variables {circumflex over(P)}_(L*) and {circumflex over (P)}_(C). M(⋅) Represents a function ofcalculating an average value. That is, α and β may be values calculatedusing linearly-interpolated sample values as variables. The method ofcalculating α and β using the linearly-interpolated sample values asvariables belongs to the scope of the invention.

P_(L*) represents a linearly-interpolated value of a reconstructed lumasample calculated in consideration of the phase difference as shown inExpression 3.

P _(L*)(x,y)=0.5×[P _(L)(2x,2y)+P _(L)(2x,2y+1)]  Expression 3

FIG. 4 is a diagram illustrating luma sample values located around andinside a current block according to an embodiment of the invention.

Referring to FIG. 4, a first sample 400 represents a sub-sampled lumasample used to calculate parameters α and β. A second sample 410represents a sample obtained by linearly interpolating a sub-sampledluma sample used to calculate parameters α and β.

A third sample 420 represents a sub-sampled luma sample used tocalculate a chroma sample. A fourth sample 430 represents a sub-sampledluma sample performed linear interpolation and used to calculate achroma sample.

That is, in the chroma sample prediction method using luma samplesaccording to the embodiment of the invention, luma sample values may becalculated by performing the linear interpolation in consideration ofthe difference in distance between the luma samples and the chromasamples and linearly-interpolated luma sample, not luma sample itself,may be used to predict the chroma samples. By using this linearinterpolation method, it is possible to further accurately predict thechroma signal in an image format in which the chroma signal and the lumasignal are different in position. The luma sample values may becalculated by performing the linear interpolation on the basis of thedifference in phase and sampling rate between the luma samples and thechroma samples. This embodiment also belongs to the scope of theinvention.

In an embodiment in which an LM is used, the following method may beused.

The following expressions represent calculating intra-predicted valuesof a chroma block using the LM.

k3=Max(0,BitDepth_(C)+Log 2(nS)−14)

p _(Y)′[x,−1]=(P _(LM)[2x−1,−1]+2*P _(LM)[2x,−1]+P _(LM)[2x+1,−1]+2)>>2,with x=0 . . . nS−1

p _(Y)′[−1,y]=(P _(LM)[−1,2y]+P _(LM)[−1,2y+1])>>1, with y=0 . . . nS−1

p _(Y)′[x,y]=recSamples_(L)[2x,2y]+recSamples_(L)[2x,2y+1])>>1, withx,y=0 . . . nS−1  Expression 4

In Expression 4, a new first variable may be calculated using the linearinterpolation as described above.

A second variable for calculating α and β may be calculated using thefirst variable calculated through Expression 4, as shown in Expression5.

$\begin{matrix}{\mspace{76mu} {{L = {\left( {{\sum\limits_{y = 0}^{{nS} - 1}\; {p_{Y}^{\prime}\left\lbrack {{- 1},y} \right\rbrack}} + {\sum\limits_{x = 0}^{{nS} - 1}\; {p_{Y}^{\prime}\left\lbrack {x,{- 1}} \right\rbrack}}} \right)\mspace{14mu} \text{>>}\mspace{14mu} k\; 3}}\mspace{76mu} {C = {\left( {{\sum\limits_{y = 0}^{{nS} - 1}\; {p\left\lbrack {{- 1},y} \right\rbrack}} + {\sum\limits_{x = 0}^{{nS} - 1}\; {p\left\lbrack {x,{- 1}} \right\rbrack}}} \right)\mspace{14mu} \text{>>}\mspace{14mu} k\; 3}}\mspace{76mu} {{LL} = {\left( {{\sum\limits_{y = 0}^{{nS} - 1}\; {p_{Y}^{\prime}\left\lbrack {{- 1},y} \right\rbrack}^{2}} + {\sum\limits_{x = 0}^{{nS} - 1}\; {p_{Y}^{\prime}\left\lbrack {x,{- 1}} \right\rbrack}^{2}}} \right)\mspace{14mu} \text{>>}\mspace{14mu} k\; 3}}{{LC} = {\left( {{\sum\limits_{y = 0}^{{nS} - 1}\; {{p_{Y}^{\prime}\left\lbrack {{- 1},y} \right\rbrack}^{*}{p\left\lbrack {{- 1},y} \right\rbrack}}} + {\sum\limits_{x = 0}^{{nS} - 1}\; {{p_{Y}^{\prime}\left\lbrack {x,{- 1}} \right\rbrack}^{*}{p\left\lbrack {x,{- 1}} \right\rbrack}}}} \right)\mspace{14mu} \text{>>}\mspace{14mu} k\; 3}}\mspace{76mu} {{k\; 2} = {{Log}\; 2\left( {\left( {2^{*}{nS}} \right)\mspace{14mu} \text{>>}\mspace{14mu} k\; 3} \right)}}}} & {{Expression}\mspace{14mu} 5}\end{matrix}$

The values of α and β may be calculated on the basis of the secondvariable, which is calculated through Expression 5, using Expression 6.

a1=(LC<<k2)−L*C

a2−(LL<<k2)−L*L

k1=Max(0,Log 2(abs(a2))−5)−Max(0,Log 2(abs(a1))−14)+2

a1s=a1>>Max(0,Log 2(abs(a1))−14)

a2s=abs(a2>>Max(0,Log 2(abs(a2))−5))

a3=a2s<1?0:Clip3(−2¹⁵,2¹⁵−1,a1s*lm Div+(1<<(k1−1))>>k1)

α=a3>>Max(0,Log 2(abs(a3))−6)

k=13−Max(0,Log 2(abs(a))−6)

β=(L−((a*C)>>k1)+(1<<(k2−1)))>>k2  Expression 6

The chroma block samples using the LM may be calculated on the basis ofα and β, which are calculated through Expression 6, using Expression 7.

predSamples[x,y]=Clip1_(C)(((P _(Y)′[x,y]*α)>>>k)+β), with x,y=0 . . .nS−1  Expression 7

In Expressions 4 to 7, similarly to the above-mentioned method, linearinterpolation may be performed on the basis of the relation between thechroma sample and the luma sample, α and β may be calculated using therelation between the calculated variables, and intra prediction may beperformed using the LM in the chroma block on the basis of thecalculated values.

This method premises that an image format is YUV 4:2:0. When the imageformat is an image format other than the YUV 4:2:0 (for example, 4:4:4or 4:0:0), the above-described linear interpolation expression may varydepending on the positional relation between the chroma sample and theluma sample. This embodiment also belongs to the scope of the invention.

Table 1 represents intra prediction modes and intra prediction modeindices mapped onto the intra prediction modes according to anembodiment of the invention.

TABLE 1 Intra prediction mode Associated names  0 Intra_Planar  1Intra_DC Otherwise (2..34) Intra_Angular 35 Intra_FromLuma (used onlyfor chroma)

Referring to Table 1, the luma block may be intra-predicted using zerothto 34-th intra prediction modes. The zeroth intra prediction mode is aplanar mode, the first intra prediction mode is a DC mode as anon-directive intra prediction mode, and the second to 34-th intraprediction modes are directive intra prediction modes. The intraprediction may be performed on the basis of prediction angles differentdepending on the indices.

FIG. 5 is a conceptual diagram illustrating a directive intra predictionmethod according to an embodiment of the invention.

Referring to FIG. 5, the directive intra prediction modes have differentintra prediction directions in the clockwise direction from the secondintra prediction mode up to the 34-th intra prediction mode.

All the directive intra prediction modes shown in FIG. 5 may be used toperform intra prediction on a luma block. However, all the directiveintra prediction modes are not used but only some directive intraprediction modes may be used to perform intra prediction on a chromablock.

The intra prediction on a chroma block may use an oblique intraprediction mode (the 34-th intra prediction mode), a vertical intraprediction mode (the 26-th intra prediction mode), a horizontal intraprediction mode (the tenth intra prediction mode), and a DC intraprediction mode. In addition, an LM (Luma Estimated Mode) in which achroma block is predicted on the basis of a reconstructed luma blockwhich is an intra prediction mode different from that of a luma blockand a DM (Luma Directed Mode) which is the same intra prediction mode asthe luma block may be used to intra-predict a chroma block.

Table 2 is a table illustrating the mapping relationship between theintra prediction mode and the intra prediction mode index when the LM,the vertical intra prediction mode (VER), the horizontal intraprediction mode (HOR), the DC intra prediction mode, and the DM are usedto intra-predict a chroma block.

TABLE 2 intra_chroma_ Prediction mode of luma component pred_type VERHOR DC ANG(X) 0 LM LM LM LM 1 n/a VER VER VER 2 HOR n/a HOR HOR 3 DC DCn/a DC 4 VER HOR DC X

Referring to Table 2, the intra prediction on a chroma block may beperformed using the LM (Luma Estimated Mode) when intra_chroma_pred_typeis 0, the vertical intra prediction mode (VER) whenintra_chroma_pred_type is 1, the horizontal intra prediction mode (HOR)when intra_chroma_pred_type is 2, the DC intra prediction mode whenintra_chroma_pred_type is 3, and the DM (Luma Directed Mode) whenintra_chroma_pred_type is 4.

When a luma block and a chroma block use the same intra prediction mode,the intra prediction mode of the chroma block may be expressed by the DMand thus it is not necessary to map the intra prediction mode index ontoone intra prediction mode of the above-mentioned five intra predictionmodes of a chroma block. For example, when the intra prediction mode ofa luma block is the vertical intra prediction mode (VER) and the intraprediction mode of a chroma block is the vertical intra prediction mode(VER), the intra prediction mode of the chroma block may be expressed bythe DM of intra_chroma_pred_type 4 and thus it is not necessary to mapthe intra prediction mode on the intra_chroma_pred_type 1. In the samemanner, when the intra prediction mode of a luma block is the verticalintra prediction mode (VER), the horizontal intra prediction mode (HOR),and the DC intra prediction mode (DC), the intra prediction mode of achroma block may be expressed by four intra_chroma_pred_types.

When the intra prediction mode of a luma block is the directive intraprediction modes other than the vertical intra prediction mode, thehorizontal intra prediction mode, and the DC mode, the DM mode and theintra prediction mode of the luma block do not overlap and thus theintra prediction on the chroma block may be performed using fiveintra_chroma_pred_types, unlike the case where the DM mode and the intraprediction mode of the luma block overlap.

The intra prediction mode used to perform the intra prediction on achroma block and the mapping relationship between the intra predictionmode and the intra prediction mode index may arbitrarily change. Whetherthe LM should be used for a chroma block may be determined in theencoding and decoding step, and Table 2 may vary depending on whetherthe LM is used.

For example, as described in tables 3 and 4, the oblique intraprediction mode (the 34-th intra prediction mode) and the planar modemay be additionally used as the intra prediction mode of a chroma block.

Table 3 shows the mapping relationship between the intra prediction modeof a chroma block and the intra prediction mode indices when the intraprediction on the chroma block is performed without using the LM.

TABLE 3 intra_chroma_ IntraPredMode[xB][yB] pred_mode 0 26 10 1 X (0 <=X < 35) 0 34 0 0 0 0 1 26 34 26 26 26 2 10 10 34 10 10 3 1 1 1 34 1 4 026 10 1 X

Referring to Table 3, intra_chroma_pred_mode 0 is mapped on the planarmode, intra_chroma_pred_mode 1 is mapped on the vertical intraprediction mode (the 26-th intra prediction mode),intra_chroma_pred_mode 2 is mapped on the horizontal intra predictionmode (the tenth intra prediction mode), intra_chroma_pred_mode 3 ismapped on the DC mode (the first intra prediction mode), andintra_chroma_pred_mode 4 is mapped on the DM.

When the intra prediction mode of a luma block is the planar mode, thevertical mode, the horizontal mode, or the DC mode, the intra predictionmode of a chroma block may be expressed by the DM. Accordingly, theoblique intra prediction mode (the 34-th intra prediction mode) insteadof the intra prediction mode expressed by the DM may be used as anadditional intra prediction mode to intra-predict a chroma block.

Table 4 shows the relationship between the intra prediction mode of aluma block and the intra prediction mode of a chroma block when theintra prediction is performed on the chroma block using the LM mode.

TABLE 4 intra_chroma_ IntraPredMode[xB][yB] pred_mode 0 26 10 1 X (0 <=X < 35) 0 34 0 0 0 0 1 26 34 26 26 26 2 10 10 34 10 10 3 1 1 1 34 1 4 LMLM LM LM LM 5 0 26 10 1 X

Referring to Table 4, the intra prediction modes of a chroma block maybe mapped on the planar mode when intra_chroma_pred_mode is 0, thevertical intra prediction mode when intra_chroma_pred_mode is 1, thehorizontal intra prediction mode when intra_chroma_pred_mode is 2, theDC mode when intra_chroma_pred_mode is 3, the LM whenintra_chroma_pred_mode is 4, and the DM when intra_chroma_pred_mode is5.

Similarly to Table 4, the intra prediction mode of a luma block is theplanar mode, the vertical mode, the horizontal mode, and the DC mode,the intra prediction mode of a chroma block may be expressed by the DM.Accordingly, the oblique intra prediction mode (the 34-th intraprediction mode) instead of the intra prediction mode among theintra_chroma_pred_modes, which may be expressed by the DM, may be used.

In the intra prediction modes of a chroma block mapped as describedabove, the intra prediction mode information of a chroma block may betransferred through the use of a codeword mapping method shown in Table6.

The table like Table 3 in which the intra prediction modes of a lumablock are mapped on the intra prediction modes of a chroma block withoutincluding the LM is defined as a non-LM mapping table. The table likeTable 4 in which the intra prediction modes of a luma block are mappedon the intra prediction modes of a chroma block to include the LM isdefined as an LM mapping table.

Referring to Tables 3 and 4, an intra prediction mode unnecessary due tothe DM is set to the oblique intra prediction mode (the 34-th intraprediction mode). However, the intra prediction modes other than the34-th intra prediction mode, such as the 18-th intra prediction mode andthe second intra prediction mode, may be used instead of the 34-th intraprediction mode. This embodiment also belongs to the scope of theinvention.

Information on what intra prediction mode should be used as asubstituent intra prediction mode may be expressed by schedo codes asdescribed in the below table.

TABLE 5 For(int i=2;i<6;i++) { If(chroma_mode[i]==luma_mode) {chroma_mode[i]=SUBSTITUTE_MODE Break; } }

Referring to Table 5, when the intra prediction mode of a luma block andthe intra prediction mode of a chroma block are equal to each other, theintra prediction mode to substitute the same intra prediction mode of achroma block as the intra prediction mode of a luma block may beexpressed by syntax element information such as substitute_mode toperform the intra prediction on the chroma block.

In order to signal the intra prediction mode of a chroma block asdescribed in the above-mentioned embodiments, codewords may be mapped onthe intra prediction modes to signal the intra prediction modes asdescribed in the below table.

Table 6 is a table in which codewords are mapped on the intra predictionmodes of a chroma block according to an embodiment of the invention.

TABLE 6 Mode number Mode Name Codeword 0 Luma Directed Mode 0 1 LumaEstimated Mode 10 2 Vertical Mode 110 3 Horizontal Mode 1110 4 DC Mode1111

Referring to Table 6, there are mode numbers, intra prediction modenames mapped on the mode numbers, and codewords corresponding thereto.The DM is mapped on codeword “0”, the LM is mapped on codeword “10”, thevertical mode is mapped on codeword “110”, the horizontal mode is mappedon codeword “1110”, and the DC mode is mapped on codeword “1111”. Asdescribed in Table 6, a fixed codewords may be mapped on the intraprediction modes of a chroma block regardless of the intra predictionmodes of a luma block, or a method of not mapping a codeword on anon-used intra prediction mode but mapping codewords on the used intraprediction modes depending on the intra prediction mode of a luma blockmay be used.

TABLE 6-1 intra_chroma_ Prediction mode of luma component pred_type VERHOR DC ANG(X) 0 10 10 10 10 1 n/a 111 111 111 2 111 n/a 110 1111 3 110110 n/a 1110 4 0 0 0 0

Referring to Table 6-1, by not mapping a codeword on a non-used intraprediction mode but mapping codewords on the used intra prediction modesdepending on the intra prediction mode of a luma block, the codewordsfor expressing the intra prediction modes of a chroma block may beflexibly mapped depending on the intra prediction mode of a luma block.

As another method of mapping the intra prediction modes and thecodewords, a fixed codeword mapping method as described in Table 7 maybe used when the intra prediction modes of a chroma block are mapped onthe codewords as described in Tables 3 and 4.

TABLE 7 mode_idx IHE ILC DM 0 0 LM 10 X mode 0 1100 100 mode 1 1101 101mode 2 1110 110 mode 3 1111 111

Referring to Table 7, in order to predict the intra prediction modes ofa chroma block, the case where the intra prediction is performed toinclude the LM and the case where the intra prediction is performedwithout using the LM may be distinguished as described above, and theintra prediction modes and the codewords corresponding to the intraprediction modes may be mapped according to one of the cases.

When the intra prediction mode on a chroma block is performed to includethe LM, the intra prediction on a chroma block may be performed usingthe DM, the LM, and the four intra prediction modes (mode 0, mode 1,mode 2, and mode 3). When the intra prediction on a chroma block isperformed without using the LM, the intra prediction may be performedusing the DM and four intra prediction modes (mode 0, mode 1, mode 2,and mode 3).

The codewords described in Table 7 may be encoded and decoded throughthe use of a bypassing method of bypassing the values themselves withoutusing any context. In the bypassing method, all bits of a codeword maybe bypassed, but bits representing the DM and bits representing the LMmay be encoded using a context. That is, when the LM mode is used, firsttwo bits are encoded using a context. When the LM mode is not used, onlythe first bit may be context-encoded. The codeword encoding method isarbitrary and various methods may be used. For example, when calculationdoes not have to be performed fast, contexts may be assigned to all bitsof a codeword to encode the bits. The various binarization method of theintra prediction mode may be used.

Table 8 is a table representing the mapping relationship between intraprediction modes and codewords when mode 0 is the planar mode, mode 1 isthe vertical intra prediction mode, mode 2 is the horizontal intraprediction mode, and mode 3 is the DC intra prediction mode on the basisof the mapping relationship between the intra prediction modes of achroma block and the codewords shown in Table 7.

TABLE 8 Value of chroma_pred_from_ chroma_pred_from_ intra_chroma_luma_enabled_ luma_enabled_ pred_mode flag = 1 flag = 0 5 0 n/a 4 10 0 01100 100 1 1101 101 2 1110 110 3 1111 111

Referring to Table 8, chroma_pred_from_luma_enabled_flag=1 representsthat the intra prediction on a chroma block is performed using the LM.Codewords may be fixedly mapped on the corresponding intra predictionmodes such as the DM when intra_chroma_pred_mode is 5, the LM whenintra_chroma_pred_mode is 4, the planar mode when intra_chroma_pred_modeis 0, the VER when intra_chroma_pred_mode is 1, the HOR whenintra_chroma_pred_mode is 2, and the DC when intra_chroma_pred_mode is3.

Chroma_pred_from_luma_enabled_flag=0 represents that the intraprediction on a chroma block is performed without using the LM mode.Codewords may be fixedly mapped on the corresponding intra predictionmodes such as the DM when intra_chroma_pred_mode is 4, the planar modewhen intra_chroma_pred_mode is 0, the VER when intra_chroma_pred_mode is1, the HOR when intra_chroma_pred_mode is 2, and the DC whenintra_chroma_pred_mode is 3.

FIG. 6 is a flowchart illustrating a method of calculating an intraprediction mode of a chroma block according to an embodiment of theinvention.

Referring to FIG. 6, flag information on whether the LM is used isdecoded (step S600).

When performing the intra prediction on a chroma block, the LM may beselected used and whether the LM is used to perform the intra predictionon a chroma block may be determined on the basis of the flag informationrepresenting whether the LM is used. As described above, the codewordexpressing the same intra prediction mode information may vary dependingon whether the LM is used.

The codeword including the intra prediction mode of a chroma block isreceived (step S610).

The codeword information encoded on the basis of the mappingrelationship between the intra prediction modes and the codewords asdescribed in Tables 6 and 7 may be received.

The intra prediction mode information of a chroma block is decoded onthe basis of the received codeword information (step S620).

As described above, there are various mapping tables between thecodewords and the intra prediction modes. The intra prediction modeinformation of a chroma block may be decoded on the basis of a lookuptable representing the mapping relationship between the codewords andthe intra prediction modes.

For example, when the intra prediction on a chroma block is performedusing the LM, the encoding device may encode information representingthat a chroma block is encoded in the intra prediction mode includingthe LM as flag information, and the decoding device may decode the intraprediction mode information of the chroma block on the basis of the flaginformation.

The received codeword information may be decoded into the intraprediction mode information on the basis of a lookup table.

For example, in Table 7, when the intra prediction mode information of achroma block represents the LM, the encoding may be performed using “10”as the codeword information and “10” which the encoded codewordinformation may be received as the codeword information of the chromablock by the decoding device.

The decoding device may determine that the intra prediction mode of thechroma block which is being decoded currently is the LM on the basis ofTable 7, and may decode the chroma block on the basis thereof.

FIG. 7 is a conceptual diagram illustrating a part of a predictionmodule that decodes an intra prediction mode of a chroma block accordingto an embodiment of the invention.

Referring to FIG. 7, the prediction module includes an LM mode usedetermination module 700 and an intra chroma block prediction modederivation module 720.

The LM mode use determination module 700 may determine whether the LM isused as the intra prediction mode of a chroma block of a current blockon the basis of LM use flag information of the encoding device.

The intra chroma block prediction mode derivation module 720 may derivethe intra prediction mode information on by what intra prediction modeto encode and decode the current chroma block on the basis of themapping relationship between the codewords and the intra predictionmodes of a chroma block.

For example, by using chroma_pred_flag_luma_enabled_pred_mode which isthe flag information as described in Table 7, it may be determinedwhether the LM is used for the intra prediction mode of the currentchroma block. When the LM is used and “110” is received as the codewordinformation, it represents that the second intra prediction mode is usedas the intra prediction mode (intra_chroma_pred_mode) of the currentchroma block. It is possible to derive the intra prediction modeinformation of the current chroma block in consideration of the intraprediction mode information of a luma block using Table 7 on the basisof the information of intra_chroma_pred_mode.

By using the above-mentioned intra prediction mode including the LM, itis possible to express the use of the LM by the use of the flaginformation depending on the nature of a picture and to perform theintra prediction. The value of intra_chroma_pred_mode may be derived byusing different codeword mapping tables depending on whether the LM isused. The intra prediction mode of a chroma block may be derived usingthe LM mapping table or the non-LM mapping table based on whether the LMis used depending on the derived value of intra_chroma_pred_mode. Byemploying this method, it is possible to reduce the number of bits whichis unnecessarily wasted and to transfer only necessary intra predictionmode information.

The image encoding method and the image decoding method described abovemay be embodied by the constituents of the image encoding device and theimage decoding device described above with reference to FIGS. 1 and 2.

While the invention has been described with reference to theembodiments, it will be able to be understood by those skilled in theart that the invention may be modified and changed in various formswithout departing from the spirit and scope of the invention describedin appended claims.

1. (canceled)
 2. A picture decoding method performed by a decodingapparatus, the method comprising: determining an intra luma predictionmode for a current luma block which is related to a current chromablock; deriving an intra chroma prediction mode for the current chromablock based on the intra luma prediction mode and information on anintra prediction mode; and deriving a predicted sample for the currentchroma block based on the intra chroma prediction mode, wherein theinformation on the intra prediction mode is obtained based on a binarycodeword, wherein, based on the current chroma block that LM mode isavailable, first two bits of the binary codeword are decoded based oncontext-based decoding and remaining bits of the binary codeword aredecoded based on bypass decoding, and wherein the LM mode is an intraprediction method of deriving the predicted sample for the currentchroma block based on a reconstructed sample of the current luma block.3. The method of claim 2, wherein based on the current chroma block thatthe LM mode is applied, the predicted sample for the current chromablock is derived based on linear model parameters and the reconstructedsample of the current luma block.
 4. The method of claim 3, whereinlinear model parameters comprise a first linear model parameter and asecond linear model parameter, wherein the first linear model parameteris determined based on linearly interpolated reconstructed samples ofthe current luma block and reconstructed samples of neighboring chromablock which is adjacent to the current chroma block, and wherein thesecond linear model parameter is determined based on the reconstructedsamples of the neighboring chroma block, the first linear modelparameter, and the linearly interpolated reconstructed samples of thecurrent luma block.
 5. The method of claim 3, wherein the reconstructedsamples of the current luma block comprise a first reconstructed sampleof the current luma block which is located in a coordinate of (2x, 2y)according to a coordinate system and a second reconstructed sample ofthe current luma block which is located in a coordinate of (2x, 2y+1)according to the coordinate system, wherein a top-left sample of thecurrent luma block and a top-left sample of the current chroma block arelocated in a coordinate of (0, 0) and the predicted sample of thecurrent chroma block is located in a coordinate of (x, y) according tothe coordinate system, and wherein the linearly interpolatedreconstructed sample of the current luma block is derived by linearlyinterpolating the first reconstructed sample of the current luma blockand the second reconstructed sample of the current luma block.
 6. Themethod of claim 2, wherein, based on the current chroma block that theLM mode is available, the information on the intra prediction moderepresents one of a first mode index which is related to a planar mode,a second mode index which is related to a vertical mode, a third modeindex which is related to a horizontal mode, a fourth mode index whichis related to a DC mode, a fifth mode index which is related to a DMmode, and a sixth mode index which is related to the LM mode, andwherein the DM mode represents that an intra prediction mode of thecurrent chroma block is same as the intra prediction mode of the currentluma block.
 7. The method of claim 6, wherein the binary codewordrelated to the sixth mode index represents ‘10’.
 8. The method of claim6, wherein the binary codeword is one of a binary codeword for the firstmode index which represents ‘1100’, a binary codeword for the secondmode index which represents ‘1101’, a binary codeword for the third modeindex which represents ‘1110’, a binary codeword for the fourth modeindex which represents ‘1111’, and a binary codeword for the fifth modeindex which represents ‘0’.
 9. The method of claim 2, wherein, based onthe current chroma block that the LM mode is not available, theinformation on the intra prediction mode represents one of a first modeindex which is related to a planar mode, a second mode index which isrelated to a vertical mode, a third mode index which is related to ahorizontal mode, a fourth mode index which is related to a DC mode, anda fifth mode index which is related to a DM mode, and wherein the DMmode represents that an intra prediction mode of the current chromablock is same as the intra prediction mode of the current luma block.10. The method of claim 9, wherein first one bit of the binary codewordis decoded based on context-based decoding.
 11. The method of claim 9,wherein the binary codeword is one of a binary codeword for the firstmode index which represents ‘100’, a binary codeword for the second modeindex which represents ‘101’, a binary codeword for the third mode indexwhich represents ‘110’, a binary codeword for the fourth mode indexwhich represents ‘111’, and a binary codeword for the fifth mode indexwhich represents ‘0’.
 12. The method of claim 9, wherein when theinformation on the intra prediction mode represents the first mode indexand the intra prediction mode of the current luma block is the planarmode, the intra prediction mode of the current chroma block is aright-up diagonal intra mode, wherein when the information on the intraprediction mode represents the first mode index and the intra predictionmode of the current luma block is an intra prediction mode other thanthe planar mode, the intra prediction mode of the current chroma blockis the planar mode, wherein when the information on the intra predictionmode represents the second mode index and the intra prediction mode ofthe current luma block is the vertical mode, the intra prediction modeof the current chroma block is the right-up diagonal intra mode, whereinwhen the information on the intra prediction mode represents the secondmode index and the intra prediction mode of the current luma block is anintra prediction mode other than the vertical mode, the intra predictionmode of the current chroma block is the vertical mode, wherein when theintra chroma prediction mode information on the intra prediction moderepresents the third index and the intra prediction mode of the currentluma block is the horizontal mode, the intra prediction mode of thecurrent chroma block is the right-up diagonal intra mode, wherein whenthe information on the intra prediction mode represents the third modeindex and the intra prediction mode of the current luma block is anintra prediction mode other than the horizontal mode, the intraprediction mode of the current chroma block is the horizontal mode,wherein when the information on the intra prediction mode represents thefourth mode index and the intra prediction mode of the current lumablock is the DC mode, the intra prediction mode of the current chromablock is the right-up diagonal intra mode, and wherein when theinformation on the intra prediction mode represents the fourth modeindex and the intra prediction mode of the current luma block is anintra prediction mode other than the DC mode, the intra prediction modeof the current chroma block is the DC mode.
 13. The method of claim 2,further comprising receiving flag information on the intra predictionmode indicating whether the LM mode is available for the current chromablock.
 14. A picture encoding method performed by an encoding apparatus,the method comprising: determining an intra luma prediction mode for acurrent luma block; determining an intra chroma prediction mode for acurrent chroma block which is related to the current luma block;generating information on an intra prediction mode based on the intraluma prediction mode and the intra chroma prediction mode; and encodingimage information including the information on the intra predictionmode, wherein the information on the intra prediction mode is encodedbased on a binary codeword, wherein, based on the current chroma blockthat LM mode is available, first two bits of the binary codeword areencoded based on context-based coding and remaining bits of the binarycodeword are encoded based on bypass coding, and wherein the LM mode isan intra prediction method of deriving a predicted sample for thecurrent chroma block based on a reconstructed sample of the current lumablock.
 15. The method of claim 14, wherein based on the current chromablock that the LM mode is applied, the predicted sample for the currentchroma block is derived based on linear model parameters and thereconstructed sample of the current luma block.
 16. A non-transitorydecoder-readable storage medium storing information causing a decodingapparatus to perform a picture decoding method, the method comprising:determining an intra luma prediction mode for a current luma block whichis related to a current chroma block; deriving an intra chromaprediction mode for the current chroma block based on the intra lumaprediction mode and information on an intra prediction mode; andderiving a predicted sample for the current chroma block based on theintra chroma prediction mode, wherein the information on the intraprediction mode is obtained based on a binary codeword, wherein, basedon the current chroma block that LM mode is available, first two bits ofthe binary codeword are decoded based on context-based decoding andremaining bits of the binary codeword are decoded based on bypassdecoding, and wherein the LM mode is an intra prediction method ofderiving the predicted sample for the current chroma block based on areconstructed sample of the current luma block.